package com.jsj.bootdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jsj.bootdemo.common.BaseResponse;
import com.jsj.bootdemo.pojo.metadata;
import com.jsj.bootdemo.pojo.metadataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface metadataMapper extends BaseMapper<metadata> {

    @Select("SELECT metadata_name FROM metadata WHERE metadata_number =" +
            "any(SELECT metadata_number FROM power WHERE company_number=" +
            "(SELECT company_number FROM company WHERE company_name=#{companyName}))")
    public List<metadataVo> departmentAuthority(@Param("companyName") String companyName);
}
